// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// Copyright (c) KALEIDOS INC

@use "refactor/common-refactor.scss" as deprecated;
@use "../../../sidebar/common/sidebar.scss" as sidebar;

.element-set {
  margin: 0;
}

.title-spacing-layout-element {
  margin: 0 0 deprecated.$s-4 0;
}

.title-spacing-empty {
  padding-left: deprecated.$s-2;
}

.flex-element-menu {
  @include sidebar.option-grid-structure;
  gap: var(--sp-xs);
}

.behaviour-menu {
  display: grid;
  column-gap: var(--sp-xs);
  grid-template-columns: auto auto;
}

.vertical-behaviour {
  .rotated {
    transform: rotate(90deg);
  }
}

.z-index-wrapper {
  @extend .input-element;
  @include deprecated.bodySmallTypography;
  grid-column: 6 / span 3;
}

.row {
  display: flex;
  gap: var(--sp-xs);
}

.position-row,
.behavior-row,
.align-row,
.margin-row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
}

.position-options {
  width: 100%;
  grid-column: 1 / span 5;
}

.margin-row {
  display: grid;
  grid-template-columns:
    var(--grid-exception-input-width) /* first input block */
    var(--grid-exception-input-width) /* second input block */
    var(--sp-xxxl); /* action button */
  gap: var(--sp-xs);
}

.margin-mode {
  @extend .button-tertiary;
  grid-column: 3;
  height: deprecated.$s-32;
  svg {
    @extend .button-icon;
  }
  &.selected {
    @extend .button-icon-selected;
  }
}

.margin-simple {
  display: grid;
  gap: var(--sp-xs);
  grid-template-columns: subgrid;
  .vertical-margin,
  .horizontal-margin {
    @extend .input-element;
    @include deprecated.bodySmallTypography;
  }
  .vertical-margin {
    grid-column: 1;
  }
  .horizontal-margin {
    grid-column: 2;
  }
}

.margin-multiple {
  display: grid;
  grid-template-columns: subgrid;
  gap: var(--sp-xs);
}

.top-margin,
.bottom-margin,
.left-margin,
.right-margin {
  @extend .input-element;
  @include deprecated.bodySmallTypography;
}

.top-margin {
  grid-column: 1;
  grid-row: 1;
}

.bottom-margin {
  grid-column: 2;
  grid-row: 1;
}

.left-margin {
  grid-column: 1;
  grid-row: 2;
}

.right-margin {
  grid-column: 2;
  grid-row: 2;
}

.advanced-options {
  display: grid;
  grid-template-columns:
    var(--grid-exception-input-width) /* first input block */
    var(--grid-exception-input-width) /* second input block */
    var(--sp-xxxl); /* action button */
  gap: var(--sp-xs);
}

.horizontal-fill,
.vertical-fill {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
}

.layout-item-min-w,
.layout-item-min-h,
.layout-item-max-w,
.layout-item-max-h {
  @extend .input-element;
  @include deprecated.bodySmallTypography;
  .icon-text {
    justify-content: flex-start;
    width: deprecated.$s-80;
    padding-top: deprecated.$s-2;
  }
}

.inputs-wrapper {
  grid-column: 1 / span 2;
}
